﻿<!DOCTYPE>
<html>

<head>
  <meta http-equiv="X-UA-Compatible" content="IE=EDGE;IE=11;IE=8,chrome=1" />
  <title>主材消耗定额管理</title>
  <link href="/InSiteWebApplication/Content/Easyui/themes/metro/easyui.css" rel="stylesheet" />
  <link href="/InSiteWebApplication/Content/Easyui/custom-easyui.css" rel="stylesheet" />
  <link href="/InSiteWebApplication/Content/Easyui/themes/icon.css" rel="stylesheet" />
  <link rel="stylesheet" href="/InSiteWebApplication/Content/webuploader/webuploader.css" />
  <style type="text/css">
    .l-btn2 {
      border: #d2d2d2 1px solid;
      font-family: Tahoma, Helvetica;
      font-size: 10px;
      cursor: pointer;
      font-weight: 500;
      text-decoration: none;
      height: 26px;
      color: #fff;
      background: #02bfbf;
    }

    .l-btn2:hover {
      color: #fff;
      background: #05d2d2;
    }

    .btnNews {
      height: 20px;
      width: 50px;
      text-align: center;
      text-decoration: none;
      display: inline-block;
      font-size: 9px;
      margin: 2px 2px;
      cursor: pointer;
      color: Black;
      border-radius: 1px;
      box-shadow: 0px 1px 0px #3d6b93;
      line-height: 10px;
      text-align: center;
      text-decoration: none;
      transition: background-color 0.15s ease-in-out;
    }
  </style>
</head>

<body>
  <div id="mainSec">
    <div class="panelSection">
      <div class="easyui-panel " title="查询区域" style="padding: 3px; width: 100%"
        data-options="closable:false,collapsible:true,minimizable:false,maximizable:false">
        <form id="queryForm" action="">
          <div style="margin: 3px 0px 3px 3px">
            <div style="float: left;">
              <div class="divLabel" style="margin-bottom: 5px">
                型号：</div>
              <input id="txtModelName_qf" name="modelName" class="easyui-textbox" style="width: 120px;
                            height: 20px" />
            </div>
            <div style="float: left; margin-left: 10px;">
              <div class="divLabel" style="margin-bottom: 5px">
                零件号：</div>
              <input id="txtProductName_qf" name="productName" class="easyui-textbox" style="width: 120px;
                            height: 20px" />
            </div>
            <div style="float: left; margin-left: 10px">
              <div class="divLabel" style="margin-bottom: 5px">
                物料编码：</div>
              <input id="txtMaterialName_qf" name="materialName" class="easyui-textbox" style="width: 120px;
                            height: 20px" />
            </div>
            <!-- <div style="float: left; margin-left: 10px;">
                        <div class="divLabel" style="margin-bottom: 5px">
                            状态：</div>
                        <select style='width: 100px; height: 20px' id='selStatus' name="status" data-options="editable:false,panelHeight:'auto'"
                            class='easyui-combobox'>
                            <option value="">请选择</option>
                            <option value="1">启用</option>
                            <option value="0">停用</option>
                        </select>
                    </div>-->
            <div style="float: left; margin-left: 20px">
              <a id="btnSearch" href='#' class="easyui-linkbutton" style="margin-top: 16px; width: 80px">
                查询</a> <a id="btnReset" href='#' class="easyui-linkbutton" style="margin-top: 16px;
                                margin-left: 5px;">重置</a>
            </div>
            <div style="clear: both">
            </div>
          </div>
        </form>
      </div>
    </div>
    <div class="panelSection">
      <div class="easyui-panel " title="结果区域" style="padding: 3px; width: 100%"
        data-options="closable:false,collapsible:true,minimizable:false,maximizable:false">
        <div style="margin: 3px 0px 3px 3px; width: 99%">
          <a id="btnAdd" href='#' class="easyui-linkbutton" style="width: 80px; height: 22px;
                        height: 25px; margin-top: -18px; padding-top: 5px">添加</a> <a id="btnEdit" href='#'
            class="easyui-linkbutton" style="width: 80px; height: 22px; height: 25px; margin-top: -18px;
                            padding-top: 5px">修改</a> <a id="btnDele" href='#' class="easyui-linkbutton" style="width: 80px;
                                height: 22px; height: 25px; margin-top: -18px; padding-top: 5px">删除</a>
          <a id="btnImport" href='#' style="width: 150px; height: 22px;">EXCEL导入</a>
          <a href="/InSiteWebApplication/Temp2/导入模板/主材消耗定额管理导入模板.xlsx" class="easyui-linkbutton" style="width: 80px; height: 22px;
                        height: 25px; margin-top: -18px; padding-top: 5px">模板下载</a>
          <span style="color:red;font-weight:bold;margin-left: 10px;">内部系统，禁止处理涉密信息！</span>
          <!--                    <a id="btnInportModelDL" href='#' class="easyui-linkbutton"
                                style="width: 100px; height: 22px; height: 25px; margin-top: -18px; padding-top: 5px">
                                导入模板下载</a>-->
        </div>
        <div style="margin: 3px 0px 3px 3px; width: 99%;height:70%">
          <table id="gdMaterialInfo" class="easyui-datagrid" style="width: 100%; height: 100%"
            data-options="fitColumns:true,rownumbers:true">
          </table>
          <div id="pp" style="float: right" class="easyui-pagination" data-options="   
                 layout:['list','first','prev','next','last','manual','info'],              
                    total: 0,
                    showPageList: true,
                    showPageInfo: false,
                    showRefresh: false,
                    afterPageText:'共&nbsp{pages}&nbsp页',
                    buttons:[{
                            iconCls:'',
                            text:'Go',
                            id:'pageGo'
                    }]  
                ">
          </div>
        </div>
      </div>
    </div>
  </div>
  <div id="dg" style="padding: 20px 0 0 0; display: none; width: 520px; height: 450px" data-options="title:'主材消耗定额编辑'">
    <form id="dgMaterialForm" action="">
      <div style="margin-top: 10px; float: left">
        <div class="divLabel" style="width: 90px; margin-top: 10px; text-align: right; display: inline-block">
          型号：</div>
        <input id="txtModelName_mf" name="modelName" class="easyui-textbox" style="width: 150px;
                height: 26px" data-options="required:true" />
        <div class="divLabel" style="width: 80px; margin-top: 10px; text-align: right; display: inline-block">
          件号：</div>
        <input id="txtProductName_mf" name="productName" class="easyui-textbox" style="width: 150px;
                height: 26px" data-options="required:true" />
      </div>
      <div style="margin-top: 10px; float: left">
        <div class="divLabel" style="width: 90px; margin-top: 10px; text-align: right; display: inline-block">
          物料编码：</div>
        <input id="txtMaterialName_mf" name="materialName" class="easyui-textbox" style="width: 150px;
                height: 26px" data-options="required:true" />
        <div class="divLabel" style="width: 80px; margin-top: 10px; text-align: right; display: inline-block">
          物料名称：</div>
        <input id="txtMaterialDesc_mf" name="materialDesc" class="easyui-textbox" style="width: 150px;
                height: 26px" />
      </div>
      <div style="margin-top: 10px; float: left">
        <div class="divLabel" style="width: 90px; margin-top: 10px; text-align: right; display: inline-block">
          牌号：</div>
        <input id="txtMaterialVendorModel_mf" name="materialVendorModel" class="easyui-textbox"
          style="width: 150px; height: 26px" />
        <div class="divLabel" style="width: 80px; margin-top: 10px; text-align: right; display: inline-block">
          规格：</div>
        <input id="txtMaterialSpecification_mf" name="materialSpecification" class="easyui-textbox"
          style="width: 150px; height: 26px" />
      </div>
      <div style="margin-top: 10px; float: left">
        <div class="divLabel" style="width: 90px; margin-top: 10px; text-align: right; display: inline-block">
          技术标准：</div>
        <input id="txtMaterialTechStandard_mf" name="materialTechStandard" class="easyui-textbox"
          style="width: 150px; height: 26px" />
        <div class="divLabel" style="width: 80px; margin-top: 10px; text-align: right; display: inline-block">
          类别：</div>
        <select style='width: 150px; height: 26px' id='sltMaterialCategory_mf' name="materialCategory"
          data-options="editable:false,panelHeight:'auto'" class='easyui-combobox'>
          <option value="1">类别1</option>
          <option value="2">类别2</option>
        </select>
      </div>
      <div style="margin-top: 10px; float: left">
        <div class="divLabel" style="width: 90px; margin-top: 10px; text-align: right; display: inline-block">
          单件消耗定额：</div>
        <input id="txtSingleConsumeNum_mf" name="singleConsumeNum" class="easyui-numberbox"
          style="width: 150px; height: 26px" data-options="required:true,min:0,precision:2" />
        <div class="divLabel" style="width: 80px; margin-top: 10px; text-align: right; display: inline-block">
          单台数量：</div>
        <input id="txtSingleDemandNum_mf" name="singleDemandNum" class="easyui-numberbox"
          style="width: 150px; height: 26px" data-options="required:true,min:0" />
      </div>
      <div style="margin-top: 10px; float: left">
        <div class="divLabel" style="width: 90px; margin-top: 10px; text-align: right; display: inline-block">
          计量单位：</div>
        <input id="txtCalculateUnit_mf" name="calculateUnit" class="easyui-textbox" style="width: 150px;
                height: 26px" />
        <div class="divLabel" style="width: 80px; margin-top: 10px; text-align: right; display: inline-block">
          备注：</div>
        <input id="txtRemark_mf" name="remark" class="easyui-textbox" style="width: 150px;
                height: 26px" />
      </div>
    </form>
    <div style="margin-top: 40px; text-align: right; padding-right: 10px; float: right">
      <a href="javascript:void(0);" id="btnSave" class="easyui-linkbutton not-custom l-btn2 " data-options=""
        style="margin-left: 0px; height: 30px; width: 100px">确定</a>
      <a href="javascript:void(0);" id="btnCancel" class="easyui-linkbutton not-custom l-btn2 " data-options=""
        style="margin-left: 10px; height: 30px; width: 60px">取消</a>
    </div>
  </div>
  <div id="dgImport" style="display: none">
    <table id="importTable" class="easyui-datagrid" data-options="rownumbers:true">
    </table>
  </div>
</body>

</html>
<script src="/InSiteWebApplication/Scripts/CustomPageJs/ReferenceJsLib.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script type="text/javascript" src="/InSiteWebApplication/Content/webuploader/webuploader.js"></script>
<script src="/InSiteWebApplication/Scripts/CustomPageJs/CustomCommon.js" type="text/javascript"></script>
<script type="text/javascript">
  /*
创建人：zhangrj
日期：2024-06-06
描述：主材消耗定额维护js
*/
  var page = {
    pageTotal: 0,
    pageSize: 20,
    pageNumber: 1,
    rootPath: getRootPath(), //网站根路径
    url: getRootPath() + "/Ashx/ReBiaoConainer/MainMaterialsConsumeHandler.ashx",
    commonUrl: getRootPath() + "/Ashx/CommonHandler.ashx",
    //初始化页面
    init: function () {
      page.bind();
      editPage.bind();//初始化编辑弹窗
      importPage.bind();//初始化导入
      customizedEasyuiPagination('pp'); //定制化分页
      $('.webuploader-pick').css("padding", "3.5px 5px"); //改变上传按钮样式
    },
    //页面事件绑定
    bind: function () {
      //列表加载
      $("#gdMaterialInfo").datagrid({
        onLoadSuccess: function (data) {
          $('#pp').pagination('refresh', {	// 改变选项，并刷新分页栏信息
            total: page.pageTotal,
            pageSize: page.pageSize,
            pageNumber: page.pageNumber
          });
          customizedEasyuiPagination('pp'); //定制化分页
        },
        columns: [[
          { field: 'ck', title: '选择', checkbox: true },
          { field: 'MODELNAME', title: '型号', width: 120 },
          { field: 'PRODUCTNAME', title: '零件号', width: 120 },
          { field: 'DESCRIPTION', title: '零件名称', width: 150 },
          { field: 'MATERIALNAME', title: '物料编码', width: 120 },
          { field: 'MATERIALDESC', title: '物料名称', width: 120 },
          { field: 'MATERIALVENDORMODEL', title: '牌号', width: 100 },
          { field: 'MATERIALSPECIFICATION', title: '规格', width: 100 },
          { field: 'MATERIALTECHSTANDARD', title: '技术标准', width: 100 },
          { field: 'MATERIALCATEGORY', title: '类别', width: 100 },
          { field: 'SINGLECONSUMENUM', title: '单件消耗定额', width: 120 },
          { field: 'CALCULATEUNIT', title: '计量单位', width: 80 },
          { field: 'SINGLEDEMANDNUM', title: '单台数量', width: 100 },
          { field: 'REMARK', title: '备注', width: 150 }
        ]]
      });

      //查询按钮
      $('#btnSearch').on("click", function () {
        page.clearPage(false, true);
        page.pageNumber = 1;
        page.searchData();
      });
      //添加按钮
      $('#btnAdd').on("click", function () {
        page.openDialog(false);
      });
      //修改按钮
      $('#btnEdit').on("click", function () {
        page.openDialog(true);
      });
      //删除按钮
      $('#btnDele').on("click", function () {
        page.clearPage(false, false);
        page.deleteData();
      });
      //分页事件
      $('#pp').pagination({
        onSelectPage: function (pageNumber, pageSize) {
          //                customizedEasyuiPagination('pp'); //定制化分页
          page.pageSize = pageSize; page.pageNumber = pageNumber === 0 ? 1 : pageNumber;
          page.searchData();
        }
      });
      //绑定分页go按钮
      $('#pageGo').on("click", function () {
        var pageNumber = Number($(this).parents('tr').find('.pagination-num').val());
        page.pageSize = $(".pagination-page-list").val();
        page.pageNumber = pageNumber;
        page.searchData();
      });
      //清除按钮
      $('#btnReset').on("click", function () {
        page.clearPage(true, true);
        page.pageNumber = 1; page.pageTotal = 0
        $('#pp').pagination('refresh', {
          total: page.pageTotal,
          pageSize: page.pageSize,
          pageNumber: page.pageNumber
        });
      });
    },
    //查询
    searchData: function () {
      var params = {
        action: "GetMainMaterialsConsumeData",
        pageSize: page.pageSize,
        pageIndex: page.pageNumber
      };
      var queryFormData = $("#queryForm").serializeArray();
      $.each(queryFormData, function () {
        params[this.name] = this.value;
      });
      page.post(page.url, params, true, function (res) {
        if (!res.Result) {
          displayMessage(res.Message, res.Result);
          return;
        }
        page.pageTotal = res.RowCount;
        $("#gdMaterialInfo").datagrid('loadData', { total: res.RowCount, rows: res.DBTable });
      });
    },
    //删除
    deleteData: function () {
      var selectRow = $("#gdMaterialInfo").datagrid("getChecked");
      if (selectRow.length === 0) {
        displayMessage("请选择数据", false);
        return false;
      }
      var datas = selectRow.map(function (item) {
        return {
          materialID: item.MAINMATERIALSCONSUMEINFOID
        }
      });
      var params = {
        action: "DeleMaterialsConsumeInfoByID",
        datas: JSON.stringify(datas)
      };
      page.post(page.url, params, true, function (res) {
        if (res.Result) {
          page.searchData();
        }
        displayMessage(res.Message, res.Result);
      });
    },
    //打开编辑弹窗
    openDialog: function (isEdit) {
      editPage.materialID = "";
      if (isEdit) { //编辑
        var selectRow = $("#gdMaterialInfo").datagrid("getChecked");
        if (selectRow.length === 0) {
          displayMessage("请选择数据", false);
          return false;
        }
        if (selectRow.length > 1) {
          displayMessage("请选择一条数据进行编辑", false);
          return false;
        }
        editPage.materialID = selectRow[0].MAINMATERIALSCONSUMEINFOID; //记录编辑的数据ID
      }
      page.disableBtn(); //禁用主页面按钮
      $('#dg').dialog({
        onClose: function () {
          page.enableBtn();
        }
      });
      editPage.init();
    },
    //禁用页面按钮
    disableBtn: function () {
      $("#mainSec").find(".easyui-linkbutton").each(function () {
        $(this).linkbutton('disable');
      });
    },
    //启用页面按钮
    enableBtn: function () {
      $("#mainSec").find(".easyui-linkbutton").each(function () {
        $(this).linkbutton('enable');
      });
    },
    //清除页面（查询区域，列表区域）
    clearPage: function (query, list) {
      if (query) {
        $("#txtProductName_qf").textbox("clear");
        $("#txtModelName_qf").textbox("clear");
        $("#txtMaterialName_qf").textbox("clear");
      }
      if (list) {
        clearEasyuiDataGrid("gdMaterialInfo"); //清空列表
      }
    },
    //post数据（路径，参数，是否异步，成功返回方法）
    post: function (url, param, async, callback) {
      $.ajax({
        type: "Post",
        url: url,
        data: param,
        cashe: false,
        async: async,
        dataType: "json",
        beforeSend: function () {
          $.messager.progress({ text: '', msg: '处理中...' });
        },
        success: function (data) {
          $.messager.progress('close');
          callback(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
          $.messager.progress('close');
          displayMessage(XMLHttpRequest.responseText, false);
          $("body").find(".easyui-linkbutton").each(function () {
            $(this).linkbutton('enable');
          });
        }
      });
    }
  };
  //弹窗编辑对象
  var editPage = {
    materialID: "",
    init: function () {
      editPage.clearPage();
      editPage.bindPageData();
    },
    bind: function () {
      //规则弹窗保存
      $('#btnSave').on("click", function () {
        editPage.saveData();
      });
      //规则弹窗取消
      $('#btnCancel').on("click", function () {
        $('#dg').dialog("close");
      });
    },
    //绑定页面数据（编辑）
    bindPageData: function () {
      if (editPage.materialID !== "") {
        page.post(page.url, { action: "GetMaterialsConsumeInfoByID", materialID: editPage.materialID }, true, function (res) {
          if (!res.Result) {
            displayMessage(res.Message, res.Result);
            return;
          }
          $("#txtProductName_mf").textbox({ readonly: true });
          $("#txtMaterialName_mf").textbox({ readonly: true });
          $("#txtModelName_mf").textbox("setValue", res.DBTable[0]["MODELNAME"]);
          $("#txtProductName_mf").textbox("setValue", res.DBTable[0]["PRODUCTNAME"]);
          $("#txtMaterialName_mf").textbox("setValue", res.DBTable[0]["MATERIALNAME"]);
          $("#txtMaterialDesc_mf").textbox("setValue", res.DBTable[0]["MATERIALDESC"]);
          $("#txtMaterialVendorModel_mf").textbox("setValue", res.DBTable[0]["MATERIALVENDORMODEL"]);
          $("#txtMaterialSpecification_mf").textbox("setValue", res.DBTable[0]["MATERIALSPECIFICATION"]);
          $("#txtMaterialTechStandard_mf").textbox("setValue", res.DBTable[0]["MATERIALTECHSTANDARD"]);
          $("#sltMaterialCategory_mf").combobox("setValue", res.DBTable[0]["MATERIALCATEGORY"]);
          $("#txtSingleConsumeNum_mf").numberbox("setValue", res.DBTable[0]["SINGLECONSUMENUM"]);
          $("#txtSingleDemandNum_mf").numberbox("setValue", res.DBTable[0]["SINGLEDEMANDNUM"]);
          $("#txtCalculateUnit_mf").textbox("setValue", res.DBTable[0]["CALCULATEUNIT"]);
          $("#txtRemark_mf").textbox("setValue", res.DBTable[0]["REMARK"]);
        });
      }
    },
    //保存数据
    saveData: function () {
      var vaild = $('#dgMaterialForm').form('validate');
      if (vaild === false) {
        displayMessage("请填写必填项", false);
        return;
      }
      var params = {
        materialID: editPage.materialID
      };
      var dgformData = $("#dgMaterialForm").serializeArray();
      $.each(dgformData, function () {
        params[this.name] = this.value;
      });
      page.post(page.url, { action: "SaveMainMaterialsConsumeInfo", params: JSON.stringify(params) }, true, function (res) {
        if (res.Result) {
          $('#dg').dialog("close");
          page.searchData();
        }
        displayMessage(res.Message, res.Result);
      });
    },
    //清空页面数据
    clearPage: function () {
      $("#txtModelName_mf").textbox("clear");
      $("#txtProductName_mf").textbox("clear");
      $("#txtMaterialName_mf").textbox("clear");
      $("#txtMaterialDesc_mf").textbox("clear");
      $("#txtMaterialVendorModel_mf").textbox("clear");
      $("#txtMaterialSpecification_mf").textbox("clear");
      $("#txtMaterialTechStandard_mf").textbox("clear");
      $("#sltMaterialCategory_mf").combobox("clear");
      $("#txtSingleConsumeNum_mf").numberbox("clear");
      $("#txtSingleDemandNum_mf").numberbox("clear");
      $("#txtCalculateUnit_mf").textbox("clear");
      $("#txtRemark_mf").textbox("clear");
    }
  };
  //导入对象
  var importPage = {
    //绑定事件
    bind: function () {
      $("#importTable").datagrid({
        columns: [[
          {
            field: 'ResultMessage', title: '导入结果', width: 300, formatter: function (value, row, index) {
              if (row.IsResult) {
                return "<span color='blue'>" + value + "</span>";
              } else {
                return "<span color='red'>" + value + "</span>";
              }
            }
          },
          { field: '型号', title: '型号', width: 120 },
          { field: '零件号', title: '零件号', width: 120 },
          { field: '物料编码', title: '物料编码', width: 100 },
          { field: '物料名称', title: '物料名称', width: 60 },
          { field: '牌号', title: '牌号', width: 60 },
          { field: '规格', title: '规格', width: 80 },
          { field: '技术标准', title: '技术标准', width: 80 },
          { field: '类别', title: '类别', width: 80 },
          { field: '单件消耗定额', title: '单件消耗定额', width: 80 },
          { field: '计量单位', title: '计量单位', width: 80 },
          { field: '单台需求数', title: '单台需求数', width: 80 },
          { field: '备注', title: '备注', width: 80 }
        ]]
      });
      // //导入模板下载
      // $('#btnInportModelDL').on("click", function () {
      //     window.open(page.rootPath + "/Temp2/导入模板/自动开卡规则维护导入模板.xlsx");
      // });
      // //导出数据
      // $('#btnExportRule').on("click", function () {
      //     var params = {
      //         action: "ExportAutoStartRuleToExcel"
      //     };
      //     var queryFormData = $("#queryForm").serializeArray();
      //     $.each(queryFormData, function () {
      //         params[this.name] = this.value;
      //     });
      //     FileDownLoad(page.url, params);
      // });
      importPage.uploader();
    },
    //导入组件初始化
    uploader: function () {
      var uploaderSeq = WebUploader.create({
        // swf文件路径
        swf: page.rootPath + "/Content/webuploader/Uploader.swf",
        // 文件接收服务端。
        server: page.url,
        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
        pick: '#btnImport',
        // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
        resize: false,
        formData: {
          action: "ImportMainMaterialsConsume",
        },
        accept: {
          title: 'Excel',
          extensions: 'xlsx,xls',
          mimeTypes: 'excel/*'
        },
      });
      // 当有文件被添加进队列的时候，每次只传一个文件
      uploaderSeq.on('fileQueued', function (file) {
        clearMessage();
        uploaderSeq.upload();
        $.messager.progress({ text: '', msg: '处理中...' });
      });
      //上传成功
      uploaderSeq.on('uploadSuccess', function (file, response) {
        clearMessage();
        var result = response;
        $.messager.progress('close');
        if (result.Result) {
          importPage.loadResultData(result.DBTable);
        }
        displayMessage(result.Message, result.Result);
        var f = uploaderSeq.getFile(file.id); //找到上传的文件
        uploaderSeq.removeFile(f, true); //将其从队列中的删掉

      });
      //上传失败
      uploaderSeq.on('uploadError', function (file) {
        displayMessage("上传失败", false);
        var f = uploaderSeq.getFile(file.id); //找到上传的文件
        uploaderSeq.removeFile(f, true); //将其从队列中的删掉
        $.messager.progress('close');
      });
    },
    //导入结果列表
    loadResultData: function (data) {
      $('#dgImport').dialog({
        title: '导入结果',
        top: 50,
        width: '700px',
        height: '500px',
        closed: false,
        cache: false,
        modal: true,
        buttons: [{
          text: '关闭',
          handler: function () { $('#dgImport').dialog('close'); }
        }]
      });
      $("#importTable").datagrid('loadData', data);
    }
  };
  $(function () {
    page.init();
  });
</script>